//
//  TopLineView.m
//  hnGovernment
//
//  Created by 安仔 on 17/2/28.
//  Copyright © 2017年 安仔. All rights reserved.
//

#import "TopLineView.h"
@interface TopLineView ()<UIGestureRecognizerDelegate>

@property (nonatomic, strong) UIImageView *signImg;
@property (nonatomic, strong) UIView *lineView;

@end


@implementation TopLineView

- (instancetype) initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    if (self) {
        self.signImg = [[UIImageView alloc] init];
        self.signImg.image = [UIImage imageNamed:@"home_topLine1"];
        self.signImg.clipsToBounds = YES;
        self.signImg.userInteractionEnabled = YES;
        [self addSubview:self.signImg];
        [self.signImg mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.mas_centerY);
            make.left.mas_equalTo(self.mas_left).offset(30*m6Scale);
            make.size.mas_equalTo(CGSizeMake(76*m6Scale, 76*m6Scale));

        }];
        UITapGestureRecognizer * PrivateLetterTap=[[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(tapAvatarView:)];
        PrivateLetterTap.delegate= self;
        [self.signImg addGestureRecognizer:PrivateLetterTap];
        
        self.lineView = [[UIView alloc] init];
        self.lineView.backgroundColor = RGB(237, 237, 237);
        [self addSubview:self.lineView];
        [self.lineView mas_makeConstraints:^(MASConstraintMaker *make) {
            make.centerY.mas_equalTo(self.mas_centerY);
            make.left.mas_equalTo(self.signImg.mas_right).offset(30*m6Scale);
            make.size.mas_equalTo(CGSizeMake(1, 110*m6Scale));

        }];
    }
    return self;
}


- (void)tapAvatarView:(UIGraphicsRenderer *)sender {
    
    if ([self.delegete respondsToSelector:@selector(TopLineViewClickToNews)]) {
        [self.delegete TopLineViewClickToNews];
    }
}



@end
